// EBASdll.cpp : Implementation of DLL Exports.


// Note: Proxy/Stub Information
//      To build a separate proxy/stub DLL, 
//      run nmake -f EBASdllps.mk in the project directory.

#include "stdafx.h"
#include "resource.h"
#include <initguid.h>
#include "EBASdll.h"

#include "EBASdll_i.c"
#include "EBASSystem.h"
#include "BrugerSession.h"
#include "Studerende.h"
#include "Adresse.h"
#include "EnumIdentifikation.h"
#include "EnumStatus.h"
#include "Identifikation.h"
#include "Status.h"
#include "EnumAdresseType.h"
#include "EnumAdresse.h"
#include "AdresseType.h"
#include "PostNummer.h"
#include "EnumPostNummer.h"
#include "DatoNotat.h"
#include "EnumStuderende.h"
#include "Gruppe.h"
#include "EnumGruppe.h"
#include "EnumEjerforhold.h"
#include "Ejerforhold.h"
#include "EnumDatoNotat.h"
#include "Fag.h"
#include "EnumLicensInfo.h"
#include "LicensInfo.h"
#include "Bogpakke.h"
#include "KarakterSkala.h"
#include "EnumFag.h"
#include "EnumBogpakke.h"
#include "EnumKarakterSkala.h"
#include "Bog.h"
#include "EnumBog.h"
#include "Karakter.h"
#include "EnumKarakter.h"
#include "StuderendeFag.h"
#include "EnumStuderendeFag.h"
#include "FileLogging.h"

CComModule _Module;

BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_EBASSystem, CEBASSystem)
OBJECT_ENTRY(CLSID_BrugerSession, CBrugerSession)
OBJECT_ENTRY(CLSID_Studerende, CStuderende)
OBJECT_ENTRY(CLSID_Adresse, CAdresse)
OBJECT_ENTRY(CLSID_EnumIdentifikation, CEnumIdentifikation)
OBJECT_ENTRY(CLSID_EnumStatus, CEnumStatus)
OBJECT_ENTRY(CLSID_Identifikation, CIdentifikation)
OBJECT_ENTRY(CLSID_Status, CStatus)
OBJECT_ENTRY(CLSID_EnumAdresseType, CEnumAdresseType)
OBJECT_ENTRY(CLSID_EnumAdresse, CEnumAdresse)
OBJECT_ENTRY(CLSID_AdresseType, CAdresseType)
OBJECT_ENTRY(CLSID_PostNummer, CPostNummer)
OBJECT_ENTRY(CLSID_EnumPostNummer, CEnumPostNummer)
OBJECT_ENTRY(CLSID_DatoNotat, CDatoNotat)
OBJECT_ENTRY(CLSID_EnumStuderende, CEnumStuderende)
OBJECT_ENTRY(CLSID_Gruppe, CGruppe)
OBJECT_ENTRY(CLSID_EnumGruppe, CEnumGruppe)
OBJECT_ENTRY(CLSID_EnumEjerforhold, CEnumEjerforhold)
OBJECT_ENTRY(CLSID_Ejerforhold, CEjerforhold)
OBJECT_ENTRY(CLSID_EnumDatoNotat, CEnumDatoNotat)
OBJECT_ENTRY(CLSID_Fag, CFag)
OBJECT_ENTRY(CLSID_EnumLicensInfo, CEnumLicensInfo)
OBJECT_ENTRY(CLSID_LicensInfo, CLicensInfo)
OBJECT_ENTRY(CLSID_Bogpakke, CBogpakke)
OBJECT_ENTRY(CLSID_KarakterSkala, CKarakterSkala)
OBJECT_ENTRY(CLSID_EnumFag, CEnumFag)
OBJECT_ENTRY(CLSID_EnumBogpakke, CEnumBogpakke)
OBJECT_ENTRY(CLSID_EnumKarakterSkala, CEnumKarakterSkala)
OBJECT_ENTRY(CLSID_Bog, CBog)
OBJECT_ENTRY(CLSID_EnumBog, CEnumBog)
OBJECT_ENTRY(CLSID_Karakter, CKarakter)
OBJECT_ENTRY(CLSID_EnumKarakter, CEnumKarakter)
OBJECT_ENTRY(CLSID_StuderendeFag, CStuderendeFag)
OBJECT_ENTRY(CLSID_EnumStuderendeFag, CEnumStuderendeFag)
END_OBJECT_MAP()

class CEBASdllApp : public CWinApp
{
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CEBASdllApp)
	public:
    virtual BOOL InitInstance();
    virtual int ExitInstance();
	//}}AFX_VIRTUAL

	//{{AFX_MSG(CEBASdllApp)
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

BEGIN_MESSAGE_MAP(CEBASdllApp, CWinApp)
	//{{AFX_MSG_MAP(CEBASdllApp)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

CEBASdllApp theApp;

BOOL CEBASdllApp::InitInstance()
{
    _Module.Init(ObjectMap, m_hInstance, &LIBID_EBASDLLLib);
    return CWinApp::InitInstance();
}

int CEBASdllApp::ExitInstance()
{
    _Module.Term();
    return CWinApp::ExitInstance();
}

/////////////////////////////////////////////////////////////////////////////
// Used to determine whether the DLL can be unloaded by OLE

STDAPI DllCanUnloadNow(void)
{
    AFX_MANAGE_STATE(AfxGetStaticModuleState());
    return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;
}

/////////////////////////////////////////////////////////////////////////////
// Returns a class factory to create an object of the requested type

STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
    return _Module.GetClassObject(rclsid, riid, ppv);
}

/////////////////////////////////////////////////////////////////////////////
// DllRegisterServer - Adds entries to the system registry

STDAPI DllRegisterServer(void)
{
    // registers object, typelib and all interfaces in typelib
    return _Module.RegisterServer(TRUE);
}

/////////////////////////////////////////////////////////////////////////////
// DllUnregisterServer - Removes entries from the system registry

STDAPI DllUnregisterServer(void)
{
    return _Module.UnregisterServer(TRUE);
}



